﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using TeleRad.Entities;
using TeleRad.Repository;

namespace TeleRad.Services
{
    public class AccountService : TeleRad.Services.IAccountService
    {
        private readonly IRepository<PatientInfo> PatientInfo_Repository;
        public AccountService(IRepository<PatientInfo> PatientInfo_Repository)
        {
            this.PatientInfo_Repository = PatientInfo_Repository;
        }

        public bool IsValidLogIn(string UserName,string Password)
        {
            int result = PatientInfo_Repository.Table.Where(p=>p.UserName == UserName && p.Password == Password).Count();
            if (result > 0)
                return true;
            else
                return false;
        }

    }
}